d3065acf14a76c1c6ef597f8d6acf9a9c3da24c8,src/test/java/org/elasticsearch/ttl/SimpleTTLTests.java,SimpleTTLTests,testSimpleTTL,#,59
Before Change
long providedTTLValue = 3000;
logger.info("--> checking ttl");
// Index one doc without routing, one doc with routing, one doc with not TTL and no default and one doc with default TTL
client().prepareIndex("test", "type1", "1").setSource("field1", "value1").setTTL(providedTTLValue).setRefresh(true).execute().actionGet();
long now = System.currentTimeMillis();
client().prepareIndex("test", "type1", "with_routing").setSource("field1", "value1").setTTL(providedTTLValue).setRouting("routing").setRefresh(true).execute().actionGet();
client().prepareIndex("test", "type1", "no_ttl").setSource("field1", "value1").execute().actionGet();
After Change
// Index one doc without routing, one doc with routing, one doc with not TTL and no default and one doc with default TTL
long now = System.currentTimeMillis();
IndexResponse indexResponse = client().prepareIndex("test", "type1", "1").setSource("field1", "value1")
.setTimestamp(String.valueOf(now)).setTTL(providedTTLValue).setRefresh(true).get();
assertThat(indexResponse.isCreated(), is(true));
indexResponse = client().prepareIndex("test", "type1", "with_routing").setSource("field1", "value1")
.setTimestamp(String.valueOf(now)).setTTL(providedTTLValue).setRouting("routing").setRefresh(true).get();